package com.panda.web.utils.pageutils;

import com.panda.web.entity.py.Job;

import java.util.List;

public class PageResult<T> {
  private long total;  // 总条数
  private int code;    // 返回状态
  private String msg;  // 返回消息
  private List<T> rows; // 列表数据

  private int pageNum;   // 当前页号
  private int pageSize;  // 每页记录数

  public static final int SUCCESS_CODE = 200;
  public static final String SUCCESS_MSG = "ok";

  // 构造函数
  public PageResult(List<T> rows, long total, int pageNum, int pageSize,String msg,int code) {
    this.total = total;
    this.rows = rows;
    this.code = SUCCESS_CODE;
    this.msg = SUCCESS_MSG;
    this.pageNum = pageNum;
    this.pageSize = pageSize;
  }
  public PageResult(List<T> rows, long total, int pageNum, int pageSize) {
    this.total = total;
    this.rows = rows;
    this.code = SUCCESS_CODE;
    this.msg = SUCCESS_MSG;
    this.pageNum = pageNum;
    this.pageSize = pageSize;
  }

  public PageResult() {

  }



  // Getters 和 Setters

  public int getPageNum() {
    return pageNum;
  }

  public void setPageNum(int pageNum) {
    this.pageNum = pageNum;
  }

  public int getPageSize() {
    return pageSize;
  }

  public void setPageSize(int pageSize) {
    this.pageSize = pageSize;
  }

  public long getTotal() {
    return total;
  }

  public void setTotal(long total) {
    this.total = total;
  }

  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public List<T> getRows() {
    return rows;
  }

  public void setRows(List<T> rows) {
    this.rows = rows;
  }
}
